package com.example.mystore.service;

import com.example.mystore.model.Admin;
import com.example.mystore.model.User;
import com.example.mystore.repository.AdminRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AdminService {

    @Autowired
    private AdminRepository adminRepository;

    public Admin findByUserId(Long userId) {
        return adminRepository.findByUserId(userId);
    }

    public void saveAdmin(Admin admin) {
        adminRepository.save(admin);
    }
}
